Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@openreplay/tracker-vuex

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openreplay/tracker-vuex

Tracker plugin for Vuex state recording

  • 3.0.0
  • npm
  • Socket score

Version published
Weekly downloads
612
decreased by-7.83%
Maintainers
2
Weekly downloads
 
Created
Source

OpenReplay Tracker Vuex plugin

A Vuex plugin for OpenReplay Tracker. This plugin allows you to see the application state during session replay.

Installation

npm i @openreplay/tracker-vuex

Usage

Initialize the @openreplay/tracker package as usual and load the plugin into it. Then put the generated plugin into your plugins field of your store.

import Vuex from 'vuex'
import Tracker from '@openreplay/tracker';
import trackerVuex from '@openreplay/tracker-vuex';

const tracker = new Tracker({
  projectKey: YOUR_PROJECT_KEY,
});

const store = new Vuex.Store({
  // ...
  plugins: [tracker.plugin(trackerVuex())],
});

You can customize the plugin behaviour with options to sanitize your data. They are similar to the ones from the standard createLogger plugin.

trackerVuex({
  filter (mutation, state) {
    // returns `true` if a mutation should be logged
    // `mutation` is a `{ type, payload }`
    return mutation.type !== "aBlacklistedMutation";
  },
  transformer (state) {
    // transform the state before logging it.
    // for example return only a specific sub-tree
    return state.subTree;
  },
  mutationTransformer (mutation) {
    // mutations are logged in the format of `{ type, payload }`
    // we can format it any way we want.
    return mutation.type;
  },
})

Keywords

FAQs

Package last updated on 30 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc